package com.proyecto.spv.client.view;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.DecoratedStackPanel;
import com.google.gwt.user.client.ui.Tree;
import com.google.gwt.user.client.ui.TreeItem;

public class PrincipalView extends Composite {

	public PrincipalView() {
		
		VerticalPanel verticalPanel = new VerticalPanel();
		initWidget(verticalPanel);
		verticalPanel.setHeight("384px");
		
		HorizontalPanel horizontalPanel = new HorizontalPanel();
		verticalPanel.add(horizontalPanel);
		horizontalPanel.setSize("449px", "38px");
		
		Image image = new Image((String) null);
		image.setAltText("logo");
		horizontalPanel.add(image);
		horizontalPanel.setCellHorizontalAlignment(image, HasHorizontalAlignment.ALIGN_CENTER);
		horizontalPanel.setCellVerticalAlignment(image, HasVerticalAlignment.ALIGN_MIDDLE);
		
		Label label = new Label("Sistema de Planilla Virtual");
		label.setStyleName("gwt-Label-Title");
		label.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		horizontalPanel.add(label);
		horizontalPanel.setCellHorizontalAlignment(label, HasHorizontalAlignment.ALIGN_CENTER);
		horizontalPanel.setCellVerticalAlignment(label, HasVerticalAlignment.ALIGN_MIDDLE);
		
		HorizontalPanel horizontalPanel_1 = new HorizontalPanel();
		verticalPanel.add(horizontalPanel_1);
		horizontalPanel_1.setSize("449px", "38px");
		
		Label lblEmpresa = new Label("Empresa XYZ");
		lblEmpresa.setStyleName("gwt-Label-Title");
		lblEmpresa.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
		horizontalPanel_1.add(lblEmpresa);
		horizontalPanel_1.setCellVerticalAlignment(lblEmpresa, HasVerticalAlignment.ALIGN_MIDDLE);
		
		Hyperlink hprlnkCambiarEmpresa = new Hyperlink("Cambiar Empresa", false, "newHistoryToken");
		horizontalPanel_1.add(hprlnkCambiarEmpresa);
		horizontalPanel_1.setCellVerticalAlignment(hprlnkCambiarEmpresa, HasVerticalAlignment.ALIGN_MIDDLE);
		horizontalPanel_1.setCellHorizontalAlignment(hprlnkCambiarEmpresa, HasHorizontalAlignment.ALIGN_RIGHT);
		
		HorizontalPanel horizontalPanel_2 = new HorizontalPanel();
		verticalPanel.add(horizontalPanel_2);
		
		DecoratedStackPanel decoratedStackPanel = new DecoratedStackPanel();
		horizontalPanel_2.add(decoratedStackPanel);
		
		Tree tree_1 = new Tree();
		decoratedStackPanel.add(tree_1, "Mantenimiento", false);
		tree_1.setSize("100%", "119px");
		
		TreeItem trtmTrabajadores = new TreeItem("Trabajadores");
		tree_1.addItem(trtmTrabajadores);
		
		TreeItem trtmAadir = new TreeItem("A\u00F1adir");
		trtmTrabajadores.addItem(trtmAadir);
		
		TreeItem trtmActaulizar = new TreeItem("Actaulizar");
		trtmActaulizar.setText("Actualizar");
		trtmTrabajadores.addItem(trtmActaulizar);
		trtmTrabajadores.setState(true);
		
		Tree tree_2 = new Tree();
		decoratedStackPanel.add(tree_2, "Planilla", false);
		tree_2.setSize("100%", "100%");
		
		TreeItem trtmNewItem = new TreeItem("New item");
		trtmNewItem.setText("Tareo semanal");
		tree_2.addItem(trtmNewItem);
		
		TreeItem trtmNewItem_1 = new TreeItem("New item");
		trtmNewItem_1.setText("Calculo de planilla semanal");
		tree_2.addItem(trtmNewItem_1);
		
		TreeItem trtmNewItem_2 = new TreeItem("New item");
		trtmNewItem_2.setText("Calculo de planilla mensual");
		tree_2.addItem(trtmNewItem_2);
		
		Tree tree = new Tree();
		decoratedStackPanel.add(tree, "Reportes", false);
		tree.setSize("100%", "100%");
		
		TreeItem trtmNewItem_3 = new TreeItem("New item");
		trtmNewItem_3.setText("Planilla semanal");
		tree.addItem(trtmNewItem_3);
		
		TreeItem trtmNewItem_5 = new TreeItem("New item");
		trtmNewItem_5.setText("Reporte consolidado");
		trtmNewItem_3.addItem(trtmNewItem_5);
		
		TreeItem trtmNewItem_6 = new TreeItem("New item");
		trtmNewItem_6.setText("Boleta de pago");
		trtmNewItem_3.addItem(trtmNewItem_6);
		trtmNewItem_3.setState(true);
		
		TreeItem trtmNewItem_4 = new TreeItem("New item");
		trtmNewItem_4.setText("Planilla mensual");
		tree.addItem(trtmNewItem_4);
		
		TreeItem trtmNewItem_7 = new TreeItem("New item");
		trtmNewItem_7.setText("Reporte consolidado");
		trtmNewItem_4.addItem(trtmNewItem_7);
		
		TreeItem trtmNewItem_8 = new TreeItem("New item");
		trtmNewItem_8.setText("Archivo para PDT");
		trtmNewItem_4.addItem(trtmNewItem_8);
		trtmNewItem_4.setState(true);
	}

}
